<?php

class User
{
    private $username;
    private $email;
    private $password;

    public function __construct($username, $email, $password)
    {
        $this->username = $username;
        $this->email = $email;
        $this->password = $password;
    }

    public function setName($name)
    {
        $this->username = $name;
    }

    public function getName()
    {
        return $this->username;
    }

    public function __destruct()
    {
        echo "User {$this->username} is destroyed";
    }

    public function __toString()
    {
        return "User {$this->username}";
    }

    public function getPassword()
    {
        return $this->password;
    }

    public function setPassword($password)
    {
        $this->password = $password;
    }

    public function getEmail()
    {
        return $this->email;
    }

    public function setEmail($email)
    {
        $this->email = $email;
    }
}

$user = new User("zhangsan", "zhangsan@qq.com", "abc123");
//echo $user->username;
//echo PHP_EOL;
//$user->password = "123456";
//echo $user->password;
//echo PHP_EOL;
$name = $user->getName();
echo $name;
echo PHP_EOL;



